{"nbformat":4,"nbformat_minor":0,"metadata":{"colab":{"name":"04_Pandas","provenance":[{"file_id":"https://github.com/GokuMohandas/MadeWithML/blob/main/notebooks/04_Pandas.ipynb","timestamp":1607977127419},{"file_id":"https://github.com/GokuMohandas/MadeWithML/blob/main/notebooks/04_Pandas.ipynb","timestamp":1582566205979}],"collapsed_sections":[],"toc_visible":true},"kernelspec":{"name":"python3","display_name":"Python 3"}},"cells":[{"cell_type":"markdown","metadata":{"id":"gPAIBMsZyhFi"},"source":["<div align=\"center\">\n","<h1><img width=\"30\" src=\"../res/maiwei.png\">&nbsp;<a href=\"https://github.com/Charmve/computer-vision-in-action\">Coumpter Vision in Action</a></h1>\n","Applied ML · MLOps · Production\n","<br>\n","Join 20K+ developers in learning how to responsibly <a href=\"https://madewithml.com/about/\">deliver value</a> with ML.\n","</div>\n","\n","<br>\n","\n","<div align=\"center\">\n","    <a target=\"_blank\" href=\"https://newsletter.madewithml.com\"><img src=\"https://img.shields.io/badge/Subscribe-20K-brightgreen\"></a>&nbsp;\n","    <a target=\"_blank\" href=\"https://github.com/GokuMohandas/MadeWithML\"><img src=\"https://img.shields.io/github/stars/GokuMohandas/MadeWithML.svg?style=social&label=Star\"></a>&nbsp;\n","    <a target=\"_blank\" href=\"https://www.linkedin.com/in/goku\"><img src=\"https://img.shields.io/badge/style--5eba00.svg?label=LinkedIn&logo=linkedin&style=social\"></a>&nbsp;\n","    <a target=\"_blank\" href=\"https://twitter.com/Charmve\"><img src=\"https://img.shields.io/twitter/follow/GokuMohandas.svg?label=Follow&style=social\"></a>\n","    <p>🔥&nbsp; Among the <a href=\"https://github.com/topics/deep-learning\" target=\"_blank\">top ML</a> repositories on GitHub</p>\n","</div>\n","\n","<br>\n","<hr>"]},{"cell_type":"markdown","metadata":{"id":"RvwFrkzSPbw7"},"source":["# Pandas\n","\n","In this lesson we will learn the basics of data manipulation using the Pandas library. "]},{"cell_type":"markdown","metadata":{"id":"0aqN-ffaP4t1"},"source":["<div align=\"left\">\n","<a target=\"_blank\" href=\"https://madewithml.com/courses/ml-foundations/pandas/\"><img src=\"https://img.shields.io/badge/📖 Read-blog post-9cf\"></a>&nbsp;\n","<a href=\"https://github.com/Charmve/computer-vision-in-action/blob/main/notebooks/04_Pandas.ipynb\" role=\"button\"><img src=\"https://img.shields.io/static/v1?label=&amp;message=View%20On%20GitHub&amp;color=586069&amp;logo=github&amp;labelColor=2f363d\"></a>&nbsp;\n","<a href=\"https://colab.research.google.com/github/Charmve/computer-vision-in-action/blob/main/notebooks/04_Pandas.ipynb\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"></a>\n","</div>"]},{"cell_type":"markdown","metadata":{"id":"ta6CPC-QT-K_"},"source":["# Set up"]},{"cell_type":"code","metadata":{"id":"6nwDfMoNT-Qa"},"source":["import numpy as np\n","import pandas as pd"],"execution_count":null,"outputs":[]},{"cell_type":"code","metadata":{"id":"VfKDIcxXT-TJ"},"source":["# Set seed for reproducibility\n","np.random.seed(seed=1234)"],"execution_count":null,"outputs":[]},{"cell_type":"markdown","metadata":{"id":"TL4rwLUSW9hV"},"source":["# Load data"]},{"cell_type":"markdown","metadata":{"id":"4EOXMnGHiLxM"},"source":["We're going to work with the [Titanic dataset](https://www.kaggle.com/c/titanic/data) which has data on the people who embarked the RMS Titanic in 1912 and whether they survived the expedition or not. It's a very common and rich dataset which makes it very apt for exploratory data analysis with Pandas.\n","\n","Let's load the data from the CSV file into a Pandas dataframe. The `header=0` signifies that the first row (0th index) is a header row which contains the names of each column in our dataset."]},{"cell_type":"code","metadata":{"id":"ywaEF_0aQ023"},"source":["# Read from CSV to Pandas DataFrame\n","url = \"https://raw.githubusercontent.com/GokuMohandas/MadeWithML/main/datasets/titanic.csv\"\n","df = pd.read_csv(url, header=0)"],"execution_count":null,"outputs":[]},{"cell_type":"code","metadata":{"id":"J79FUzZWQ-kx","colab":{"base_uri":"https://localhost:8080/","height":204},"executionInfo":{"status":"ok","timestamp":1608041637306,"user_tz":420,"elapsed":959,"user":{"displayName":"Goku Mohandas","photoUrl":"https://lh3.googleusercontent.com/a-/AOh14GjMIOf3R_zwS_zZx4ZyPMtQe0lOkGpPOEUEKWpM7g=s64","userId":"00378334517810298963"}},"outputId":"74d81a76-9d01-4ab3-b631-90476802f19a"},"source":["# First five items\n","df.head()"],"execution_count":null,"outputs":[{"output_type":"execute_result","data":{"text/html":["<div>\n","<style scoped>\n","    .dataframe tbody tr th:only-of-type {\n","        vertical-align: middle;\n","    }\n","\n","    .dataframe tbody tr th {\n","        vertical-align: top;\n","    }\n","\n","    .dataframe thead th {\n","        text-align: right;\n","    }\n","</style>\n","<table border=\"1\" class=\"dataframe\">\n","  <thead>\n","    <tr style=\"text-align: right;\">\n","      <th></th>\n","      <th>pclass</th>\n","      <th>name</th>\n","      <th>sex</th>\n","      <th>age</th>\n","      <th>sibsp</th>\n","      <th>parch</th>\n","      <th>ticket</th>\n","      <th>fare</th>\n","      <th>cabin</th>\n","      <th>embarked</th>\n","      <th>survived</th>\n","    </tr>\n","  </thead>\n","  <tbody>\n","    <tr>\n","      <th>0</th>\n","      <td>1</td>\n","      <td>Allen, Miss. Elisabeth Walton</td>\n","      <td>female</td>\n","      <td>29.0000</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>24160</td>\n","      <td>211.3375</td>\n","      <td>B5</td>\n","      <td>S</td>\n","      <td>1</td>\n","    </tr>\n","    <tr>\n","      <th>1</th>\n","      <td>1</td>\n","      <td>Allison, Master. Hudson Trevor</td>\n","      <td>male</td>\n","      <td>0.9167</td>\n","      <td>1</td>\n","      <td>2</td>\n","      <td>113781</td>\n","      <td>151.5500</td>\n","      <td>C22 C26</td>\n","      <td>S</td>\n","      <td>1</td>\n","    </tr>\n","    <tr>\n","      <th>2</th>\n","      <td>1</td>\n","      <td>Allison, Miss. Helen Loraine</td>\n","      <td>female</td>\n","      <td>2.0000</td>\n","      <td>1</td>\n","      <td>2</td>\n","      <td>113781</td>\n","      <td>151.5500</td>\n","      <td>C22 C26</td>\n","      <td>S</td>\n","      <td>0</td>\n","    </tr>\n","    <tr>\n","      <th>3</th>\n","      <td>1</td>\n","      <td>Allison, Mr. Hudson Joshua Creighton</td>\n","      <td>male</td>\n","      <td>30.0000</td>\n","      <td>1</td>\n","      <td>2</td>\n","      <td>113781</td>\n","      <td>151.5500</td>\n","      <td>C22 C26</td>\n","      <td>S</td>\n","      <td>0</td>\n","    </tr>\n","    <tr>\n","      <th>4</th>\n","      <td>1</td>\n","      <td>Allison, Mrs. Hudson J C (Bessie Waldo Daniels)</td>\n","      <td>female</td>\n","      <td>25.0000</td>\n","      <td>1</td>\n","      <td>2</td>\n","      <td>113781</td>\n","      <td>151.5500</td>\n","      <td>C22 C26</td>\n","      <td>S</td>\n","      <td>0</td>\n","    </tr>\n","  </tbody>\n","</table>\n","</div>"],"text/plain":["   pclass                                             name  ... embarked  survived\n","0       1                    Allen, Miss. Elisabeth Walton  ...        S         1\n","1       1                   Allison, Master. Hudson Trevor  ...        S         1\n","2       1                     Allison, Miss. Helen Loraine  ...        S         0\n","3       1             Allison, Mr. Hudson Joshua Creighton  ...        S         0\n","4       1  Allison, Mrs. Hudson J C (Bessie Waldo Daniels)  ...        S         0\n","\n","[5 rows x 11 columns]"]},"metadata":{"tags":[]},"execution_count":4}]},{"cell_type":"markdown","metadata":{"id":"qhYyM3iGRZ8W"},"source":["These are the different features: \n","* `class`: class of travel\n","* `name`: full name of the passenger\n","* `sex`: gender\n","* `age`: numerical age\n","* `sibsp`: # of siblings/spouse aboard\n","* `parch`: number of parents/child aboard\n","* `ticket`: ticket number\n","* `fare`: cost of the ticket\n","* `cabin`: location of room\n","* `emarked`: port that the passenger embarked at (C - Cherbourg, S - Southampton, Q - Queenstown)\n","* `survived`: survial metric (0 - died, 1 - survived)"]},{"cell_type":"markdown","metadata":{"id":"NBx5VP8K_y6N"},"source":["# Exploratory data analysis (EDA)\n","\n","Now that we loaded our data, we're ready to start exploring it to find interesting information.\n","\n","> Be sure to check out our entire lesson devoted to [EDA](https://madewithml.com/courses/mlops/exploratory-data-analysis/) in our [mlops](https://madewithml.com/#mlops) course."]},{"cell_type":"code","metadata":{"id":"c4_qAEVI0lpe"},"source":["import matplotlib.pyplot as plt"],"execution_count":null,"outputs":[]},{"cell_type":"markdown","metadata":{"id":"z1Dn2ZTHWUKo"},"source":["We can use `.describe()` to extract some standard details about our numerical features. "]},{"cell_type":"code","metadata":{"id":"thR28yTmASRr","colab":{"base_uri":"https://localhost:8080/","height":297},"outputId":"3863b800-6d83-4472-a200-88750bc94d44"},"source":["# Describe features\n","df.describe()"],"execution_count":null,"outputs":[{"output_type":"execute_result","data":{"text/html":["<div>\n","<style scoped>\n","    .dataframe tbody tr th:only-of-type {\n","        vertical-align: middle;\n","    }\n","\n","    .dataframe tbody tr th {\n","        vertical-align: top;\n","    }\n","\n","    .dataframe thead th {\n","        text-align: right;\n","    }\n","</style>\n","<table border=\"1\" class=\"dataframe\">\n","  <thead>\n","    <tr style=\"text-align: right;\">\n","      <th></th>\n","      <th>pclass</th>\n","      <th>age</th>\n","      <th>sibsp</th>\n","      <th>parch</th>\n","      <th>fare</th>\n","      <th>survived</th>\n","    </tr>\n","  </thead>\n","  <tbody>\n","    <tr>\n","      <th>count</th>\n","      <td>1309.000000</td>\n","      <td>1046.000000</td>\n","      <td>1309.000000</td>\n","      <td>1309.000000</td>\n","      <td>1308.000000</td>\n","      <td>1309.000000</td>\n","    </tr>\n","    <tr>\n","      <th>mean</th>\n","      <td>2.294882</td>\n","      <td>29.881135</td>\n","      <td>0.498854</td>\n","      <td>0.385027</td>\n","      <td>33.295479</td>\n","      <td>0.381971</td>\n","    </tr>\n","    <tr>\n","      <th>std</th>\n","      <td>0.837836</td>\n","      <td>14.413500</td>\n","      <td>1.041658</td>\n","      <td>0.865560</td>\n","      <td>51.758668</td>\n","      <td>0.486055</td>\n","    </tr>\n","    <tr>\n","      <th>min</th>\n","      <td>1.000000</td>\n","      <td>0.166700</td>\n","      <td>0.000000</td>\n","      <td>0.000000</td>\n","      <td>0.000000</td>\n","      <td>0.000000</td>\n","    </tr>\n","    <tr>\n","      <th>25%</th>\n","      <td>2.000000</td>\n","      <td>21.000000</td>\n","      <td>0.000000</td>\n","      <td>0.000000</td>\n","      <td>7.895800</td>\n","      <td>0.000000</td>\n","    </tr>\n","    <tr>\n","      <th>50%</th>\n","      <td>3.000000</td>\n","      <td>28.000000</td>\n","      <td>0.000000</td>\n","      <td>0.000000</td>\n","      <td>14.454200</td>\n","      <td>0.000000</td>\n","    </tr>\n","    <tr>\n","      <th>75%</th>\n","      <td>3.000000</td>\n","      <td>39.000000</td>\n","      <td>1.000000</td>\n","      <td>0.000000</td>\n","      <td>31.275000</td>\n","      <td>1.000000</td>\n","    </tr>\n","    <tr>\n","      <th>max</th>\n","      <td>3.000000</td>\n","      <td>80.000000</td>\n","      <td>8.000000</td>\n","      <td>9.000000</td>\n","      <td>512.329200</td>\n","      <td>1.000000</td>\n","    </tr>\n","  </tbody>\n","</table>\n","</div>"],"text/plain":["            pclass          age  ...         fare     survived\n","count  1309.000000  1046.000000  ...  1308.000000  1309.000000\n","mean      2.294882    29.881135  ...    33.295479     0.381971\n","std       0.837836    14.413500  ...    51.758668     0.486055\n","min       1.000000     0.166700  ...     0.000000     0.000000\n","25%       2.000000    21.000000  ...     7.895800     0.000000\n","50%       3.000000    28.000000  ...    14.454200     0.000000\n","75%       3.000000    39.000000  ...    31.275000     1.000000\n","max       3.000000    80.000000  ...   512.329200     1.000000\n","\n","[8 rows x 6 columns]"]},"metadata":{"tags":[]},"execution_count":9}]},{"cell_type":"code","metadata":{"id":"8KXH6dmb0iY6","colab":{"base_uri":"https://localhost:8080/","height":261},"outputId":"7c48a1ec-f546-4d96-ffb4-3e27eeb67647"},"source":["# Correlation matrix\n","plt.matshow(df.corr())\n","continuous_features = df.describe().columns\n","plt.xticks(range(len(continuous_features)), continuous_features, rotation='45')\n","plt.yticks(range(len(continuous_features)), continuous_features, rotation='45')\n","plt.colorbar()\n","pl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QocB\nqwDXAj+U9GHbC2z/AXgI2FzSCNsv1X3WQRBUUTDPrEE7a32hW4uoSoQOBSYCu9q+StLLwPdyWY8P\nk7pwHJiz7oMgaCQGNy6gsS4UWZoNIdUWOgV4K4vSIGAoKZN+XeAo28/Xc6JBEHRDC1s7RehRiGy/\nIWkaKYLyKdIy7DFSqPfXgbciYjoImkyb+4iKbt//gLRL9qjtFyV9GtgIWBAiFARNph9s3xcSotzq\nZ4akAZIOBr4A7Gv79brOLgiCQngxK54/mFSmey/bD9ZhPkEQ9JrWjhEqQq+EyPbrkq6IaOkgaCEa\nmPRaL3qdaxYiFAQtSH/fvg+CoLUx4MXNIgqCoMVwQys01oUQoiDoB7jNt+8VLp8gaG8k/RoYWfD0\nuba3r+d8+kIIURAETSda+wRB0HRCiIIgaDohREEQNJ0QoiAImk4IURAETef/A9GCAwrSLaWaAAAA\nAElFTkSuQmCC\n","text/plain":["<Figure size 288x288 with 2 Axes>"]},"metadata":{"tags":[]}}]},{"cell_type":"markdown","metadata":{"id":"oRaXx2KeWgT3"},"source":["We can also use `.hist()` to view the histrogram of values for each feature."]},{"cell_type":"code","metadata":{"id":"Mn5HqS3XmzJs","colab":{"base_uri":"https://localhost:8080/","height":282},"outputId":"fc0f691c-39d6-476d-defd-0679fe1f5da0"},"source":["# Histograms\n","df['age'].hist()"],"execution_count":null,"outputs":[{"output_type":"execute_result","data":{"text/plain":["<matplotlib.axes._subplots.AxesSubplot at 0x7f84a97cac88>"]},"metadata":{"tags":[]},"execution_count":11},{"output_type":"display_data","data":{"image/png":"iVBORw0KGgoAAAANSUhEUgAAAXcAAAD4CAYAAAAXUaZHAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjEsIGh0\ndHA6Ly9tYXRwbG90bGliLm9yZy8QZhcZAAAR8klEQVR4nO3dfWxdd33H8fd3DXQlRkmzgBWSaO60\n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xbtKbmceq\n6R8BvZ0KEhF9wOuBx+iSXNXpj73ACeAR4H+ApzNzvFqlE6/p3wB/Afy6mv+tLsg0IYF/j4g91Ud3\nQOdfy8uAHwOfq05l/VNEzO2CXPXWAvdU0x3NlZmjwCeAHwDHgFPAHtq0j52v5X5eydp/yR255jQi\neoD7gQ9m5jPdkiszn8/aj81LqH3Q3Gs6kWNCRPwxcCIz93Qyxzm8OTOvoHYqcmNE/EH9wg69lnOA\nK4DbMvP1wLOcdqqjw/v+S4G3A/96+rJO5KrO8a+h9p/iq4C5nHk6t2XO13I/Hz7e4HhELAKo7k/M\ndoCIeAm1Yr87Mx/ollz1MvNpYBe1H0fnR8TEG+tm+zV9E/D2iBih9immb6F2PrmTmf5fddRHZp6g\ndv74Sjr/Wh4FjmbmY9X8fdTKvtO5JlwDPJGZx6v5Tuf6Q+CpzPxxZv4KeIDafteWfex8Lffz4eMN\ntgPrqul11M55z5qICOB24FBmfrJbclXZXhER86vpS6j9LuAQtZJ/VyeyZeYtmbkkM/uo7U//kZk3\ndjLThIiYGxEvn5imdh55Px1+LTPzR8API+LV1dDVwMFO56pzAy+ckoHO5/oBcFVEvKz69znx/WrP\nPtapX3S04JcT1wL/Te1c7V92OMs91M6h/Yra0cxN1M7X7gSeBL4GLJjlTG+m9mPnd4C91e3aTueq\nsv0+8K0q237gr6rx3wEeB45Q+1H64g69ngPAjm7JVGX4dnU7MLG/d8lruRLYXb2W/wZc2iW55gI/\nBebVjXVDro8B3632+38GLm7XPubHD0hSgc7X0zKSpHOw3CWpQJa7JBXIcpekAlnuklQgy12SCmS5\nS1KB/g+tXaXiUCPD1wAAAABJRU5ErkJggg==\n","text/plain":["<Figure size 432x288 with 1 Axes>"]},"metadata":{"tags":[]}}]},{"cell_type":"code","metadata":{"id":"7illbHR1nLEF","colab":{"base_uri":"https://localhost:8080/","height":34},"outputId":"9fa4c46f-9e9f-4aa6-a33c-67098f9b8f15"},"source":["# Unique values\n","df['embarked'].unique()"],"execution_count":null,"outputs":[{"output_type":"execute_result","data":{"text/plain":["array(['S', 'C', nan, 'Q'], dtype=object)"]},"metadata":{"tags":[]},"execution_count":12}]},{"cell_type":"markdown","metadata":{"id":"WPQ_JS0RXkRc"},"source":["# Filtering"]},{"cell_type":"code","metadata":{"id":"BG1IMeV_hrqV","colab":{"base_uri":"https://localhost:8080/","height":119},"outputId":"89ba573a-4e47-4ff1-8040-54e21319f0fc"},"source":["# Selecting data by feature\n","df['name'].head()"],"execution_count":null,"outputs":[{"output_type":"execute_result","data":{"text/plain":["0                      Allen, Miss. Elisabeth Walton\n","1                     Allison, Master. Hudson Trevor\n","2                       Allison, Miss. Helen Loraine\n","3               Allison, Mr. Hudson Joshua Creighton\n","4    Allison, Mrs. Hudson J C (Bessie Waldo Daniels)\n","Name: name, dtype: object"]},"metadata":{"tags":[]},"execution_count":13}]},{"cell_type":"code","metadata":{"id":"wPrRGLDtiZSp","colab":{"base_uri":"https://localhost:8080/","height":204},"outputId":"58049932-1350-4176-8191-c5f15f840fa8"},"source":["# Filtering\n","df[df['sex']=='female'].head() # only the female data appear"],"execution_count":null,"outputs":[{"output_type":"execute_result","data":{"text/html":["<div>\n","<style scoped>\n","    .dataframe tbody tr th:only-of-type {\n","        vertical-align: middle;\n","    }\n","\n","    .dataframe tbody tr th {\n","        vertical-align: top;\n","    }\n","\n","    .dataframe thead th {\n","        text-align: right;\n","    }\n","</style>\n","<table border=\"1\" class=\"dataframe\">\n","  <thead>\n","    <tr style=\"text-align: right;\">\n","      <th></th>\n","      <th>pclass</th>\n","      <th>name</th>\n","      <th>sex</th>\n","      <th>age</th>\n","      <th>sibsp</th>\n","      <th>parch</th>\n","      <th>ticket</th>\n","      <th>fare</th>\n","      <th>cabin</th>\n","      <th>embarked</th>\n","      <th>survived</th>\n","    </tr>\n","  </thead>\n","  <tbody>\n","    <tr>\n","      <th>0</th>\n","      <td>1</td>\n","      <td>Allen, Miss. Elisabeth Walton</td>\n","      <td>female</td>\n","      <td>29.0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>24160</td>\n","      <td>211.3375</td>\n","      <td>B5</td>\n","      <td>S</td>\n","      <td>1</td>\n","    </tr>\n","    <tr>\n","      <th>2</th>\n","      <td>1</td>\n","      <td>Allison, Miss. Helen Loraine</td>\n","      <td>female</td>\n","      <td>2.0</td>\n","      <td>1</td>\n","      <td>2</td>\n","      <td>113781</td>\n","      <td>151.5500</td>\n","      <td>C22 C26</td>\n","      <td>S</td>\n","      <td>0</td>\n","    </tr>\n","    <tr>\n","      <th>4</th>\n","      <td>1</td>\n","      <td>Allison, Mrs. Hudson J C (Bessie Waldo Daniels)</td>\n","      <td>female</td>\n","      <td>25.0</td>\n","      <td>1</td>\n","      <td>2</td>\n","      <td>113781</td>\n","      <td>151.5500</td>\n","      <td>C22 C26</td>\n","      <td>S</td>\n","      <td>0</td>\n","    </tr>\n","    <tr>\n","      <th>6</th>\n","      <td>1</td>\n","      <td>Andrews, Miss. Kornelia Theodosia</td>\n","      <td>female</td>\n","      <td>63.0</td>\n","      <td>1</td>\n","      <td>0</td>\n","      <td>13502</td>\n","      <td>77.9583</td>\n","      <td>D7</td>\n","      <td>S</td>\n","      <td>1</td>\n","    </tr>\n","    <tr>\n","      <th>8</th>\n","      <td>1</td>\n","      <td>Appleton, Mrs. Edward Dale (Charlotte Lamson)</td>\n","      <td>female</td>\n","      <td>53.0</td>\n","      <td>2</td>\n","      <td>0</td>\n","      <td>11769</td>\n","      <td>51.4792</td>\n","      <td>C101</td>\n","      <td>S</td>\n","      <td>1</td>\n","    </tr>\n","  </tbody>\n","</table>\n","</div>"],"text/plain":["   pclass                                             name  ... embarked  survived\n","0       1                    Allen, Miss. Elisabeth Walton  ...        S         1\n","2       1                     Allison, Miss. Helen Loraine  ...        S         0\n","4       1  Allison, Mrs. Hudson J C (Bessie Waldo Daniels)  ...        S         0\n","6       1                Andrews, Miss. Kornelia Theodosia  ...        S         1\n","8       1    Appleton, Mrs. Edward Dale (Charlotte Lamson)  ...        S         1\n","\n","[5 rows x 11 columns]"]},"metadata":{"tags":[]},"execution_count":14}]},{"cell_type":"markdown","metadata":{"id":"7lYWUAcxXp0Q"},"source":["# Sorting"]},{"cell_type":"code","metadata":{"id":"FOuLeYIojMMH","colab":{"base_uri":"https://localhost:8080/","height":204},"outputId":"63667b76-73a7-4b39-9c7c-8125ad5c30cb"},"source":["# Sorting\n","df.sort_values('age', ascending=False).head()"],"execution_count":null,"outputs":[{"output_type":"execute_result","data":{"text/html":["<div>\n","<style scoped>\n","    .dataframe tbody tr th:only-of-type {\n","        vertical-align: middle;\n","    }\n","\n","    .dataframe tbody tr th {\n","        vertical-align: top;\n","    }\n","\n","    .dataframe thead th {\n","        text-align: right;\n","    }\n","</style>\n","<table border=\"1\" class=\"dataframe\">\n","  <thead>\n","    <tr style=\"text-align: right;\">\n","      <th></th>\n","      <th>pclass</th>\n","      <th>name</th>\n","      <th>sex</th>\n","      <th>age</th>\n","      <th>sibsp</th>\n","      <th>parch</th>\n","      <th>ticket</th>\n","      <th>fare</th>\n","      <th>cabin</th>\n","      <th>embarked</th>\n","      <th>survived</th>\n","    </tr>\n","  </thead>\n","  <tbody>\n","    <tr>\n","      <th>14</th>\n","      <td>1</td>\n","      <td>Barkworth, Mr. Algernon Henry Wilson</td>\n","      <td>male</td>\n","      <td>80.0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>27042</td>\n","      <td>30.0000</td>\n","      <td>A23</td>\n","      <td>S</td>\n","      <td>1</td>\n","    </tr>\n","    <tr>\n","      <th>61</th>\n","      <td>1</td>\n","      <td>Cavendish, Mrs. Tyrell William (Julia Florence...</td>\n","      <td>female</td>\n","      <td>76.0</td>\n","      <td>1</td>\n","      <td>0</td>\n","      <td>19877</td>\n","      <td>78.8500</td>\n","      <td>C46</td>\n","      <td>S</td>\n","      <td>1</td>\n","    </tr>\n","    <tr>\n","      <th>1235</th>\n","      <td>3</td>\n","      <td>Svensson, Mr. Johan</td>\n","      <td>male</td>\n","      <td>74.0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>347060</td>\n","      <td>7.7750</td>\n","      <td>NaN</td>\n","      <td>S</td>\n","      <td>0</td>\n","    </tr>\n","    <tr>\n","      <th>135</th>\n","      <td>1</td>\n","      <td>Goldschmidt, Mr. George B</td>\n","      <td>male</td>\n","      <td>71.0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>PC 17754</td>\n","      <td>34.6542</td>\n","      <td>A5</td>\n","      <td>C</td>\n","      <td>0</td>\n","    </tr>\n","    <tr>\n","      <th>9</th>\n","      <td>1</td>\n","      <td>Artagaveytia, Mr. Ramon</td>\n","      <td>male</td>\n","      <td>71.0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>PC 17609</td>\n","      <td>49.5042</td>\n","      <td>NaN</td>\n","      <td>C</td>\n","      <td>0</td>\n","    </tr>\n","  </tbody>\n","</table>\n","</div>"],"text/plain":["      pclass  ... survived\n","14         1  ...        1\n","61         1  ...        1\n","1235       3  ...        0\n","135        1  ...        0\n","9          1  ...        0\n","\n","[5 rows x 11 columns]"]},"metadata":{"tags":[]},"execution_count":15}]},{"cell_type":"markdown","metadata":{"id":"VWxbfIZnXrM4"},"source":["# Grouping"]},{"cell_type":"code","metadata":{"id":"v0TCbtSMjMO5","colab":{"base_uri":"https://localhost:8080/","height":142},"outputId":"d8893ddc-aa50-4b3c-f240-33a8bc16c6c8"},"source":["# Grouping\n","survived_group = df.groupby('survived')\n","survived_group.mean()"],"execution_count":null,"outputs":[{"output_type":"execute_result","data":{"text/html":["<div>\n","<style scoped>\n","    .dataframe tbody tr th:only-of-type {\n","        vertical-align: middle;\n","    }\n","\n","    .dataframe tbody tr th {\n","        vertical-align: top;\n","    }\n","\n","    .dataframe thead th {\n","        text-align: right;\n","    }\n","</style>\n","<table border=\"1\" class=\"dataframe\">\n","  <thead>\n","    <tr style=\"text-align: right;\">\n","      <th></th>\n","      <th>pclass</th>\n","      <th>age</th>\n","      <th>sibsp</th>\n","      <th>parch</th>\n","      <th>fare</th>\n","    </tr>\n","    <tr>\n","      <th>survived</th>\n","      <th></th>\n","      <th></th>\n","      <th></th>\n","      <th></th>\n","      <th></th>\n","    </tr>\n","  </thead>\n","  <tbody>\n","    <tr>\n","      <th>0</th>\n","      <td>2.500618</td>\n","      <td>30.545369</td>\n","      <td>0.521632</td>\n","      <td>0.328801</td>\n","      <td>23.353831</td>\n","    </tr>\n","    <tr>\n","      <th>1</th>\n","      <td>1.962000</td>\n","      <td>28.918228</td>\n","      <td>0.462000</td>\n","      <td>0.476000</td>\n","      <td>49.361184</td>\n","    </tr>\n","  </tbody>\n","</table>\n","</div>"],"text/plain":["            pclass        age     sibsp     parch       fare\n","survived                                                    \n","0         2.500618  30.545369  0.521632  0.328801  23.353831\n","1         1.962000  28.918228  0.462000  0.476000  49.361184"]},"metadata":{"tags":[]},"execution_count":16}]},{"cell_type":"markdown","metadata":{"id":"mmcNMYhnXsxC"},"source":["# Indexing"]},{"cell_type":"markdown","metadata":{"id":"-XJK5O95a5OF"},"source":["We can use `iloc` to get rows or columns at particular positions in the dataframe."]},{"cell_type":"code","metadata":{"id":"34LmckWDhdSA","colab":{"base_uri":"https://localhost:8080/","height":221},"outputId":"bf3a6150-f278-4bd1-c19d-d8779d6bf800"},"source":["# Selecting row 0\n","df.iloc[0, :] "],"execution_count":null,"outputs":[{"output_type":"execute_result","data":{"text/plain":["pclass                                  1\n","name        Allen, Miss. Elisabeth Walton\n","sex                                female\n","age                                    29\n","sibsp                                   0\n","parch                                   0\n","ticket                              24160\n","fare                              211.338\n","cabin                                  B5\n","embarked                                S\n","survived                                1\n","Name: 0, dtype: object"]},"metadata":{"tags":[]},"execution_count":17}]},{"cell_type":"code","metadata":{"id":"QrdXeuRdFkXB","colab":{"base_uri":"https://localhost:8080/","height":34},"outputId":"c9fd52c1-6e18-4a9b-ed1e-d659340e6aef"},"source":["# Selecting a specific value\n","df.iloc[0, 1]"],"execution_count":null,"outputs":[{"output_type":"execute_result","data":{"text/plain":["'Allen, Miss. Elisabeth Walton'"]},"metadata":{"tags":[]},"execution_count":18}]},{"cell_type":"markdown","metadata":{"id":"uSezrq4vEFYh"},"source":["# Preprocessing"]},{"cell_type":"markdown","metadata":{"id":"F14RY0N7a_25"},"source":["After exploring, we can clean and preprocess our dataset.\n","\n","> Be sure to check out our entire lesson focused on [preprocessing](https://madewithml.com/courses/mlops/preprocessing/) in our [mlops](https://madewithml.com/#mlops) course."]},{"cell_type":"code","metadata":{"id":"EZ1pCKHIjMUY","colab":{"base_uri":"https://localhost:8080/","height":204},"outputId":"48e3b36b-719b-4ad3-a5ec-5968b04f9976"},"source":["# Rows with at least one NaN value\n","df[pd.isnull(df).any(axis=1)].head()"],"execution_count":null,"outputs":[{"output_type":"execute_result","data":{"text/html":["<div>\n","<style scoped>\n","    .dataframe tbody tr th:only-of-type {\n","        vertical-align: middle;\n","    }\n","\n","    .dataframe tbody tr th {\n","        vertical-align: top;\n","    }\n","\n","    .dataframe thead th {\n","        text-align: right;\n","    }\n","</style>\n","<table border=\"1\" class=\"dataframe\">\n","  <thead>\n","    <tr style=\"text-align: right;\">\n","      <th></th>\n","      <th>pclass</th>\n","      <th>name</th>\n","      <th>sex</th>\n","      <th>age</th>\n","      <th>sibsp</th>\n","      <th>parch</th>\n","      <th>ticket</th>\n","      <th>fare</th>\n","      <th>cabin</th>\n","      <th>embarked</th>\n","      <th>survived</th>\n","    </tr>\n","  </thead>\n","  <tbody>\n","    <tr>\n","      <th>9</th>\n","      <td>1</td>\n","      <td>Artagaveytia, Mr. Ramon</td>\n","      <td>male</td>\n","      <td>71.0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>PC 17609</td>\n","      <td>49.5042</td>\n","      <td>NaN</td>\n","      <td>C</td>\n","      <td>0</td>\n","    </tr>\n","    <tr>\n","      <th>13</th>\n","      <td>1</td>\n","      <td>Barber, Miss. Ellen \"Nellie\"</td>\n","      <td>female</td>\n","      <td>26.0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>19877</td>\n","      <td>78.8500</td>\n","      <td>NaN</td>\n","      <td>S</td>\n","      <td>1</td>\n","    </tr>\n","    <tr>\n","      <th>15</th>\n","      <td>1</td>\n","      <td>Baumann, Mr. John D</td>\n","      <td>male</td>\n","      <td>NaN</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>PC 17318</td>\n","      <td>25.9250</td>\n","      <td>NaN</td>\n","      <td>S</td>\n","      <td>0</td>\n","    </tr>\n","    <tr>\n","      <th>23</th>\n","      <td>1</td>\n","      <td>Bidois, Miss. Rosalie</td>\n","      <td>female</td>\n","      <td>42.0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>PC 17757</td>\n","      <td>227.5250</td>\n","      <td>NaN</td>\n","      <td>C</td>\n","      <td>1</td>\n","    </tr>\n","    <tr>\n","      <th>25</th>\n","      <td>1</td>\n","      <td>Birnbaum, Mr. Jakob</td>\n","      <td>male</td>\n","      <td>25.0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>13905</td>\n","      <td>26.0000</td>\n","      <td>NaN</td>\n","      <td>C</td>\n","      <td>0</td>\n","    </tr>\n","  </tbody>\n","</table>\n","</div>"],"text/plain":["    pclass                          name     sex  ...  cabin  embarked  survived\n","9        1       Artagaveytia, Mr. Ramon    male  ...    NaN         C         0\n","13       1  Barber, Miss. Ellen \"Nellie\"  female  ...    NaN         S         1\n","15       1           Baumann, Mr. John D    male  ...    NaN         S         0\n","23       1         Bidois, Miss. Rosalie  female  ...    NaN         C         1\n","25       1           Birnbaum, Mr. Jakob    male  ...    NaN         C         0\n","\n","[5 rows x 11 columns]"]},"metadata":{"tags":[]},"execution_count":19}]},{"cell_type":"code","metadata":{"id":"zUaiFplEkmoB","colab":{"base_uri":"https://localhost:8080/","height":204},"outputId":"647d5b7a-0455-4aac-dffc-8c65b20f93b3"},"source":["# Drop rows with Nan values\n","df = df.dropna() # removes rows with any NaN values\n","df = df.reset_index() # reset's row indexes in case any rows were dropped\n","df.head()"],"execution_count":null,"outputs":[{"output_type":"execute_result","data":{"text/html":["<div>\n","<style scoped>\n","    .dataframe tbody tr th:only-of-type {\n","        vertical-align: middle;\n","    }\n","\n","    .dataframe tbody tr th {\n","        vertical-align: top;\n","    }\n","\n","    .dataframe thead th {\n","        text-align: right;\n","    }\n","</style>\n","<table border=\"1\" class=\"dataframe\">\n","  <thead>\n","    <tr style=\"text-align: right;\">\n","      <th></th>\n","      <th>index</th>\n","      <th>pclass</th>\n","      <th>name</th>\n","      <th>sex</th>\n","      <th>age</th>\n","      <th>sibsp</th>\n","      <th>parch</th>\n","      <th>ticket</th>\n","      <th>fare</th>\n","      <th>cabin</th>\n","      <th>embarked</th>\n","      <th>survived</th>\n","    </tr>\n","  </thead>\n","  <tbody>\n","    <tr>\n","      <th>0</th>\n","      <td>0</td>\n","      <td>1</td>\n","      <td>Allen, Miss. Elisabeth Walton</td>\n","      <td>female</td>\n","      <td>29.0000</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>24160</td>\n","      <td>211.3375</td>\n","      <td>B5</td>\n","      <td>S</td>\n","      <td>1</td>\n","    </tr>\n","    <tr>\n","      <th>1</th>\n","      <td>1</td>\n","      <td>1</td>\n","      <td>Allison, Master. Hudson Trevor</td>\n","      <td>male</td>\n","      <td>0.9167</td>\n","      <td>1</td>\n","      <td>2</td>\n","      <td>113781</td>\n","      <td>151.5500</td>\n","      <td>C22 C26</td>\n","      <td>S</td>\n","      <td>1</td>\n","    </tr>\n","    <tr>\n","      <th>2</th>\n","      <td>2</td>\n","      <td>1</td>\n","      <td>Allison, Miss. Helen Loraine</td>\n","      <td>female</td>\n","      <td>2.0000</td>\n","      <td>1</td>\n","      <td>2</td>\n","      <td>113781</td>\n","      <td>151.5500</td>\n","      <td>C22 C26</td>\n","      <td>S</td>\n","      <td>0</td>\n","    </tr>\n","    <tr>\n","      <th>3</th>\n","      <td>3</td>\n","      <td>1</td>\n","      <td>Allison, Mr. Hudson Joshua Creighton</td>\n","      <td>male</td>\n","      <td>30.0000</td>\n","      <td>1</td>\n","      <td>2</td>\n","      <td>113781</td>\n","      <td>151.5500</td>\n","      <td>C22 C26</td>\n","      <td>S</td>\n","      <td>0</td>\n","    </tr>\n","    <tr>\n","      <th>4</th>\n","      <td>4</td>\n","      <td>1</td>\n","      <td>Allison, Mrs. Hudson J C (Bessie Waldo Daniels)</td>\n","      <td>female</td>\n","      <td>25.0000</td>\n","      <td>1</td>\n","      <td>2</td>\n","      <td>113781</td>\n","      <td>151.5500</td>\n","      <td>C22 C26</td>\n","      <td>S</td>\n","      <td>0</td>\n","    </tr>\n","  </tbody>\n","</table>\n","</div>"],"text/plain":["   index  pclass  ... embarked survived\n","0      0       1  ...        S        1\n","1      1       1  ...        S        1\n","2      2       1  ...        S        0\n","3      3       1  ...        S        0\n","4      4       1  ...        S        0\n","\n","[5 rows x 12 columns]"]},"metadata":{"tags":[]},"execution_count":20}]},{"cell_type":"code","metadata":{"id":"ubujZv_8qG-d","colab":{"base_uri":"https://localhost:8080/","height":204},"outputId":"c269b74b-acb9-4cc7-dc1c-6ad012a4e899"},"source":["# Dropping multiple columns\n","df = df.drop(['name', 'cabin', 'ticket'], axis=1) # we won't use text features for our initial basic models\n","df.head()"],"execution_count":null,"outputs":[{"output_type":"execute_result","data":{"text/html":["<div>\n","<style scoped>\n","    .dataframe tbody tr th:only-of-type {\n","        vertical-align: middle;\n","    }\n","\n","    .dataframe tbody tr th {\n","        vertical-align: top;\n","    }\n","\n","    .dataframe thead th {\n","        text-align: right;\n","    }\n","</style>\n","<table border=\"1\" class=\"dataframe\">\n","  <thead>\n","    <tr style=\"text-align: right;\">\n","      <th></th>\n","      <th>index</th>\n","      <th>pclass</th>\n","      <th>sex</th>\n","      <th>age</th>\n","      <th>sibsp</th>\n","      <th>parch</th>\n","      <th>fare</th>\n","      <th>embarked</th>\n","      <th>survived</th>\n","    </tr>\n","  </thead>\n","  <tbody>\n","    <tr>\n","      <th>0</th>\n","      <td>0</td>\n","      <td>1</td>\n","      <td>female</td>\n","      <td>29.0000</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>211.3375</td>\n","      <td>S</td>\n","      <td>1</td>\n","    </tr>\n","    <tr>\n","      <th>1</th>\n","      <td>1</td>\n","      <td>1</td>\n","      <td>male</td>\n","      <td>0.9167</td>\n","      <td>1</td>\n","      <td>2</td>\n","      <td>151.5500</td>\n","      <td>S</td>\n","      <td>1</td>\n","    </tr>\n","    <tr>\n","      <th>2</th>\n","      <td>2</td>\n","      <td>1</td>\n","      <td>female</td>\n","      <td>2.0000</td>\n","      <td>1</td>\n","      <td>2</td>\n","      <td>151.5500</td>\n","      <td>S</td>\n","      <td>0</td>\n","    </tr>\n","    <tr>\n","      <th>3</th>\n","      <td>3</td>\n","      <td>1</td>\n","      <td>male</td>\n","      <td>30.0000</td>\n","      <td>1</td>\n","      <td>2</td>\n","      <td>151.5500</td>\n","      <td>S</td>\n","      <td>0</td>\n","    </tr>\n","    <tr>\n","      <th>4</th>\n","      <td>4</td>\n","      <td>1</td>\n","      <td>female</td>\n","      <td>25.0000</td>\n","      <td>1</td>\n","      <td>2</td>\n","      <td>151.5500</td>\n","      <td>S</td>\n","      <td>0</td>\n","    </tr>\n","  </tbody>\n","</table>\n","</div>"],"text/plain":["   index  pclass     sex      age  sibsp  parch      fare embarked  survived\n","0      0       1  female  29.0000      0      0  211.3375        S         1\n","1      1       1    male   0.9167      1      2  151.5500        S         1\n","2      2       1  female   2.0000      1      2  151.5500        S         0\n","3      3       1    male  30.0000      1      2  151.5500        S         0\n","4      4       1  female  25.0000      1      2  151.5500        S         0"]},"metadata":{"tags":[]},"execution_count":21}]},{"cell_type":"code","metadata":{"id":"8m117GcVnon9","colab":{"base_uri":"https://localhost:8080/","height":204},"outputId":"1244fad0-46e8-442c-b47b-13ba7d206d44"},"source":["# Map feature values\n","df['sex'] = df['sex'].map( {'female': 0, 'male': 1} ).astype(int)\n","df['embarked'] = df['embarked'].dropna().map( {'S':0, 'C':1, 'Q':2} ).astype(int)\n","df.head()"],"execution_count":null,"outputs":[{"output_type":"execute_result","data":{"text/html":["<div>\n","<style scoped>\n","    .dataframe tbody tr th:only-of-type {\n","        vertical-align: middle;\n","    }\n","\n","    .dataframe tbody tr th {\n","        vertical-align: top;\n","    }\n","\n","    .dataframe thead th {\n","        text-align: right;\n","    }\n","</style>\n","<table border=\"1\" class=\"dataframe\">\n","  <thead>\n","    <tr style=\"text-align: right;\">\n","      <th></th>\n","      <th>index</th>\n","      <th>pclass</th>\n","      <th>sex</th>\n","      <th>age</th>\n","      <th>sibsp</th>\n","      <th>parch</th>\n","      <th>fare</th>\n","      <th>embarked</th>\n","      <th>survived</th>\n","    </tr>\n","  </thead>\n","  <tbody>\n","    <tr>\n","      <th>0</th>\n","      <td>0</td>\n","      <td>1</td>\n","      <td>0</td>\n","      <td>29.0000</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>211.3375</td>\n","      <td>0</td>\n","      <td>1</td>\n","    </tr>\n","    <tr>\n","      <th>1</th>\n","      <td>1</td>\n","      <td>1</td>\n","      <td>1</td>\n","      <td>0.9167</td>\n","      <td>1</td>\n","      <td>2</td>\n","      <td>151.5500</td>\n","      <td>0</td>\n","      <td>1</td>\n","    </tr>\n","    <tr>\n","      <th>2</th>\n","      <td>2</td>\n","      <td>1</td>\n","      <td>0</td>\n","      <td>2.0000</td>\n","      <td>1</td>\n","      <td>2</td>\n","      <td>151.5500</td>\n","      <td>0</td>\n","      <td>0</td>\n","    </tr>\n","    <tr>\n","      <th>3</th>\n","      <td>3</td>\n","      <td>1</td>\n","      <td>1</td>\n","      <td>30.0000</td>\n","      <td>1</td>\n","      <td>2</td>\n","      <td>151.5500</td>\n","      <td>0</td>\n","      <td>0</td>\n","    </tr>\n","    <tr>\n","      <th>4</th>\n","      <td>4</td>\n","      <td>1</td>\n","      <td>0</td>\n","      <td>25.0000</td>\n","      <td>1</td>\n","      <td>2</td>\n","      <td>151.5500</td>\n","      <td>0</td>\n","      <td>0</td>\n","    </tr>\n","  </tbody>\n","</table>\n","</div>"],"text/plain":["   index  pclass  sex      age  sibsp  parch      fare  embarked  survived\n","0      0       1    0  29.0000      0      0  211.3375         0         1\n","1      1       1    1   0.9167      1      2  151.5500         0         1\n","2      2       1    0   2.0000      1      2  151.5500         0         0\n","3      3       1    1  30.0000      1      2  151.5500         0         0\n","4      4       1    0  25.0000      1      2  151.5500         0         0"]},"metadata":{"tags":[]},"execution_count":22}]},{"cell_type":"markdown","metadata":{"id":"ZaVqjpsCEtft"},"source":["# Feature engineering"]},{"cell_type":"markdown","metadata":{"id":"Dgb4InI0bcN9"},"source":["We're now going to use feature engineering to create a column called `family_size`. We'll first define a function called `get_family_size` that will determine the family size using the number of parents and siblings. "]},{"cell_type":"code","metadata":{"id":"_FPtk5tpqrDI"},"source":["# Lambda expressions to create new features\n","def get_family_size(sibsp, parch):\n","    family_size = sibsp + parch\n","    return family_size"],"execution_count":null,"outputs":[]},{"cell_type":"markdown","metadata":{"id":"FCXPqemgbo3H"},"source":["Once we define the function, we can use `lambda` to `apply` that function on each row (using the numbers of siblings and parents in each row to determine the family size for each row)."]},{"cell_type":"code","metadata":{"id":"f_Xf97AjlM6s","colab":{"base_uri":"https://localhost:8080/","height":204},"outputId":"09559817-40d0-4f4d-f046-1cbe6134518a"},"source":["df[\"family_size\"] = df[[\"sibsp\", \"parch\"]].apply(lambda x: get_family_size(x[\"sibsp\"], x[\"parch\"]), axis=1)\n","df.head()"],"execution_count":null,"outputs":[{"output_type":"execute_result","data":{"text/html":["<div>\n","<style scoped>\n","    .dataframe tbody tr th:only-of-type {\n","        vertical-align: middle;\n","    }\n","\n","    .dataframe tbody tr th {\n","        vertical-align: top;\n","    }\n","\n","    .dataframe thead th {\n","        text-align: right;\n","    }\n","</style>\n","<table border=\"1\" class=\"dataframe\">\n","  <thead>\n","    <tr style=\"text-align: right;\">\n","      <th></th>\n","      <th>index</th>\n","      <th>pclass</th>\n","      <th>sex</th>\n","      <th>age</th>\n","      <th>sibsp</th>\n","      <th>parch</th>\n","      <th>fare</th>\n","      <th>embarked</th>\n","      <th>survived</th>\n","      <th>family_size</th>\n","    </tr>\n","  </thead>\n","  <tbody>\n","    <tr>\n","      <th>0</th>\n","      <td>0</td>\n","      <td>1</td>\n","      <td>0</td>\n","      <td>29.0000</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>211.3375</td>\n","      <td>0</td>\n","      <td>1</td>\n","      <td>0</td>\n","    </tr>\n","    <tr>\n","      <th>1</th>\n","      <td>1</td>\n","      <td>1</td>\n","      <td>1</td>\n","      <td>0.9167</td>\n","      <td>1</td>\n","      <td>2</td>\n","      <td>151.5500</td>\n","      <td>0</td>\n","      <td>1</td>\n","      <td>3</td>\n","    </tr>\n","    <tr>\n","      <th>2</th>\n","      <td>2</td>\n","      <td>1</td>\n","      <td>0</td>\n","      <td>2.0000</td>\n","      <td>1</td>\n","      <td>2</td>\n","      <td>151.5500</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>3</td>\n","    </tr>\n","    <tr>\n","      <th>3</th>\n","      <td>3</td>\n","      <td>1</td>\n","      <td>1</td>\n","      <td>30.0000</td>\n","      <td>1</td>\n","      <td>2</td>\n","      <td>151.5500</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>3</td>\n","    </tr>\n","    <tr>\n","      <th>4</th>\n","      <td>4</td>\n","      <td>1</td>\n","      <td>0</td>\n","      <td>25.0000</td>\n","      <td>1</td>\n","      <td>2</td>\n","      <td>151.5500</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>3</td>\n","    </tr>\n","  </tbody>\n","</table>\n","</div>"],"text/plain":["   index  pclass  sex      age  ...      fare  embarked  survived  family_size\n","0      0       1    0  29.0000  ...  211.3375         0         1            0\n","1      1       1    1   0.9167  ...  151.5500         0         1            3\n","2      2       1    0   2.0000  ...  151.5500         0         0            3\n","3      3       1    1  30.0000  ...  151.5500         0         0            3\n","4      4       1    0  25.0000  ...  151.5500         0         0            3\n","\n","[5 rows x 10 columns]"]},"metadata":{"tags":[]},"execution_count":24}]},{"cell_type":"code","metadata":{"id":"JK3FqfjnpSNi","colab":{"base_uri":"https://localhost:8080/","height":204},"outputId":"efc2e913-053e-4b54-924c-793286de1f92"},"source":["# Reorganize headers\n","df = df[['pclass', 'sex', 'age', 'sibsp', 'parch', 'family_size', 'fare', 'embarked', 'survived']]\n","df.head()"],"execution_count":null,"outputs":[{"output_type":"execute_result","data":{"text/html":["<div>\n","<style scoped>\n","    .dataframe tbody tr th:only-of-type {\n","        vertical-align: middle;\n","    }\n","\n","    .dataframe tbody tr th {\n","        vertical-align: top;\n","    }\n","\n","    .dataframe thead th {\n","        text-align: right;\n","    }\n","</style>\n","<table border=\"1\" class=\"dataframe\">\n","  <thead>\n","    <tr style=\"text-align: right;\">\n","      <th></th>\n","      <th>pclass</th>\n","      <th>sex</th>\n","      <th>age</th>\n","      <th>sibsp</th>\n","      <th>parch</th>\n","      <th>family_size</th>\n","      <th>fare</th>\n","      <th>embarked</th>\n","      <th>survived</th>\n","    </tr>\n","  </thead>\n","  <tbody>\n","    <tr>\n","      <th>0</th>\n","      <td>1</td>\n","      <td>0</td>\n","      <td>29.0000</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>0</td>\n","      <td>211.3375</td>\n","      <td>0</td>\n","      <td>1</td>\n","    </tr>\n","    <tr>\n","      <th>1</th>\n","      <td>1</td>\n","      <td>1</td>\n","      <td>0.9167</td>\n","      <td>1</td>\n","      <td>2</td>\n","      <td>3</td>\n","      <td>151.5500</td>\n","      <td>0</td>\n","      <td>1</td>\n","    </tr>\n","    <tr>\n","      <th>2</th>\n","      <td>1</td>\n","      <td>0</td>\n","      <td>2.0000</td>\n","      <td>1</td>\n","      <td>2</td>\n","      <td>3</td>\n","      <td>151.5500</td>\n","      <td>0</td>\n","      <td>0</td>\n","    </tr>\n","    <tr>\n","      <th>3</th>\n","      <td>1</td>\n","      <td>1</td>\n","      <td>30.0000</td>\n","      <td>1</td>\n","      <td>2</td>\n","      <td>3</td>\n","      <td>151.5500</td>\n","      <td>0</td>\n","      <td>0</td>\n","    </tr>\n","    <tr>\n","      <th>4</th>\n","      <td>1</td>\n","      <td>0</td>\n","      <td>25.0000</td>\n","      <td>1</td>\n","      <td>2</td>\n","      <td>3</td>\n","      <td>151.5500</td>\n","      <td>0</td>\n","      <td>0</td>\n","    </tr>\n","  </tbody>\n","</table>\n","</div>"],"text/plain":["   pclass  sex      age  sibsp  ...  family_size      fare  embarked  survived\n","0       1    0  29.0000      0  ...            0  211.3375         0         1\n","1       1    1   0.9167      1  ...            3  151.5500         0         1\n","2       1    0   2.0000      1  ...            3  151.5500         0         0\n","3       1    1  30.0000      1  ...            3  151.5500         0         0\n","4       1    0  25.0000      1  ...            3  151.5500         0         0\n","\n","[5 rows x 9 columns]"]},"metadata":{"tags":[]},"execution_count":25}]},{"cell_type":"markdown","metadata":{"id":"N_rwgfrFGTne"},"source":["# Save data"]},{"cell_type":"markdown","metadata":{"id":"OExbbyancIk4"},"source":["Finally, let's save our preprocessed data into a new CSV file to use later."]},{"cell_type":"code","metadata":{"id":"rNNxA7Vrp2fC"},"source":["# Saving dataframe to CSV\n","df.to_csv('processed_titanic.csv', index=False)"],"execution_count":null,"outputs":[]},{"cell_type":"code","metadata":{"id":"gfc7Epp7sgqz","colab":{"base_uri":"https://localhost:8080/","height":85},"outputId":"50ee3ac9-4422-4471-c053-1a86b5600828"},"source":["# See the saved file\n","!ls -l"],"execution_count":null,"outputs":[{"output_type":"stream","text":["total 96\n","-rw-r--r-- 1 root root  6975 Dec  3 17:36 processed_titanic.csv\n","drwxr-xr-x 1 root root  4096 Nov 21 16:30 sample_data\n","-rw-r--r-- 1 root root 85153 Dec  3 17:36 titanic.csv\n"],"name":"stdout"}]}]}